package svc

type SvcForm struct {
	Id              int64      `form:"id" json:"id" binding:"min=0"`
	SvcNamespace    string     `form:"svc_namespace" json:"svc_namespace" binding:"required,max=20"`
	SvcName         string     `form:"svc_name" json:"svc_name" binding:"required,min=3,max=20"`
	SvcPodName      string     `form:"svc_pod_name" json:"svc_pod_name" binding:"required,min=3,max=20"`
	SvcTeamId       string     `form:"svc_team_id" json:"svc_team_id" binding:"required,min=1"`
	SvcPort         []*SvcPort `form:"svc_port" json:"svc_port" binding:"required,min=1"`
	SvcType         string     `form:"svc_type" json:"svc_type" binding:"omitempty,oneof='ClusterIP' 'NodePort' 'LoadBalancer' 'ExternalName'"`
	SvcExternalName string     `form:"svc_external_name" json:"svc_external_name" binding:"omitempty,min=3,max=20"`
}

type SvcPort struct {
	Id              int64  `form:"id" json:"id" binding:"min=0"`
	SvcId           int64  `form:"svc_id" json:"svc_id" binding:"min=0"`
	SvcPort         int32  `form:"svc_port" json:"svc_port" binding:"required,min=1"`
	SvcTargetPort   int32  `form:"svc_target_port" json:"svc_target_port" binding:"required,min=1"`
	SvcNodePort     int32  `form:"svc_node_port" json:"svc_node_port" binding:"omitempty,min=1"`
	SvcPortProtocol string `form:"svc_port_protocol" json:"svc_port_protocol" binding:"omitempty,oneof='TCP' 'UDP' 'SCTP'"`
}
